package com.wcs.exam.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 存储方式
 *
 * @author wcs
 */
@Getter
@AllArgsConstructor
public enum StoragePlatformEnum {

    MINIO(1, "MinIO", "minio%", "minio"),
    ALIYUN(2, "阿里云", "aliyun%", "aliyun"),
    TENCENT(3, "腾讯云", "tencent%", "tencent"),
    HUAWEI(4, "华为云", "huawei%", "huawei"),
    KODO(5, "七牛云", "kodo%", "kodo");

    private final Integer code;

    private final String desc;

    /**
     * 标记
     */
    private final String tag;

    /**
     * 模式
     */
    private final String mode;

    /**
     * 根据编码获取枚举信息
     *
     * @param code 编码
     * @return 枚举信息
     */
    public static StoragePlatformEnum byCode(Integer code) {
        for (StoragePlatformEnum val : StoragePlatformEnum.values()) {
            if (val.getCode().equals(code)) {
                return val;
            }
        }
        return null;
    }
}
